package com.zmm.zebulon.module.system.biz.dal.mysql.mail;

import com.zmm.zebulon.common.pojo.PageResult;
import com.zmm.zebulon.module.system.biz.controller.admin.mail.vo.account.MailAccountPageReqVO;
import com.zmm.zebulon.module.system.biz.dal.dataobject.mail.MailAccountDO;
import com.zmm.zebulon.starter.mybatis.mybatis.core.mapper.BaseMapperX;
import com.zmm.zebulon.starter.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * description: 邮箱账号 Mapper
 *
 * @author zebulon
 * package com.zmm.zebulon.module.system.biz.dal.mysql.mail
 * name: MailAccountMapper
 * date 2024/1/8 00:10
 */
@Mapper
public interface MailAccountMapper extends BaseMapperX<MailAccountDO> {

    default PageResult<MailAccountDO> selectPage(MailAccountPageReqVO pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<MailAccountDO>()
                .likeIfPresent(MailAccountDO::getMail, pageReqVO.getMail())
                .likeIfPresent(MailAccountDO::getUsername , pageReqVO.getUsername()));
    }

}
